package com.thb.pay.core.bean;

import lombok.Data;

import java.io.Serializable;


@Data
public class MsgAck implements Serializable {

    public static final int SUCCESS = 200;
    public static final int BUSINESS_ERROR = 400;
    public static final int ERROR = 500;
    /**
     * 序列
     */
    private static final long serialVersionUID = -8965296513558252959L;
    /**
     * 返回代码
     */
    private int code = SUCCESS;

    /**
     * 返回描述
     */
    private String desc;

    /**
     * 返回数据
     */
    private Object data;

    public MsgAck() {

    }

    public MsgAck(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public MsgAck(int code, String desc, Object data) {
        this.code = code;
        this.desc = desc;
        this.data = data;
    }

    public static MsgAck successAck() {
        return failureAck(SUCCESS, "success");
    }

    public static MsgAck failureAck(int code, String desc) {
        return new MsgAck(code, desc);
    }

    public static MsgAck messageAck(int code, String desc, Object data) {
        return new MsgAck(code, desc, data);
    }

}
